from django.test import TestCase
from news.models import *

# Create your tests here.
from news.models import News
# a = News.objects.get(id =46)
# for i in range(44):
#     a.id =None
#     a.title ='牛人' + str(i)
#     a.save()

for i in range(3, 5):
    user = User.objects.create(username=("NormalUser" + str(i)), mobile=(15300000000+i))

users = User.objects.filter(id__lt=27)
newss = News.objects.all()
for user in users:
    for news in newss:
        comments = NewsComments.objects.all()
        for comment in comments:
            c = NewsComments.objects.create(user=user, parent_id=comment, news=news, comment=(str(comment.user) + "的评论"))


users = User.objects.filter(id__lt=27)
newss = News.objects.all()
for user in users:
    for news in newss:
        comments = NewsComments.objects.all()
        for comment in comments:
            c = NewsComments.objects.create(user=user, parent_id=comment, news=news, comment=(str(comment.user) + "的评论"))